#include "stdafx.h"
#include "SecretShopDef.h"
#include "InstanceTouch.h"
DECL_INSTANCE_TOUCH(ETouch_SecretShopDef);

struct  SecretShopDefDefReflectionRegister
{
	SecretShopDefDefReflectionRegister()
	{
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_sDisplayName,std::string("DefaultName")).Editor_SetAsDisplayName();
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_vAutoRefreshHour,std::vector<int32>()).Editor_SetAsEnumationSet<EHour>();
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_iRefreshCostBase,50).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_iRefreshCostAdd,30).Editor_SetAsRaw();
		REGISTER_REFLECTION_MEMBER(SecretShopDef,m_iRefreshDropID,-1).Editor_SetAsRaw();

		GlobalClassManager::Instance().RegisterClass(SecretShopDef::s_GetReflection(),eDefaultDef_SecretShopDef);
		GlobalDefManager::Instance().RegisterDefManger(&SecretShopDefManager::Instance());

	}
}___SecretShopDefDefReflectionRegister;

rewrite  void SecretShopDef::OnArchieveReaded()
{
}

void SecretShopDefManager::OnArchieveReaded()
{
	__SecretShopDefManager::OnArchieveReaded();
	std::vector<const SecretShopDef*> vEnums;
	this->Enumerate(vEnums);
	m_pCurrentConfig=NULL;
	if(vEnums.size()>0)
	{
		m_pCurrentConfig=vEnums[0];
	}
	else
	{
		m_pCurrentConfig= &this->DefaultStaticItem(); 
	}
}